﻿<?xml version="1.0" encoding="utf-8"?>
<Witd:WITD application="Work item type editor" version="1.0" xmlns:Witd="http://schemas.microsoft.com/VisualStudio/2008/workitemtracking/typedef">
  <WORKITEMTYPE name="Feedback Request">
    <DESCRIPTION>Represents the master work item for a feedback session. Child work items should be created of the type Feedback Response.</DESCRIPTION>
    <FIELDS>
      <!-- ********** Core fields ******************* -->
      <FIELD name="Id" refname="System.Id" type="Integer" reportable="dimension" />
      <FIELD name="Title" refname="System.Title" type="String" reportable="dimension">
        <REQUIRED />
        <HELPTEXT>One line summary of the feedback being requested</HELPTEXT>
      </FIELD>
      <FIELD name="Description" refname="System.Description" type="HTML">
        <HELPTEXT>Guidance on what areas of the product that feedback should be scoped to</HELPTEXT>
      </FIELD>
      <FIELD name="Assigned To" refname="System.AssignedTo" type="String" reportable="dimension" syncnamechanges="true">
        <ALLOWEXISTINGVALUE />
        <VALIDUSER />
        <HELPTEXT>The person requesting feedback</HELPTEXT>
      </FIELD>
      <FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
      </FIELD>
      <FIELD name="Closed By" refname="Microsoft.VSTS.Common.ClosedBy" type="String" reportable="dimension" syncnamechanges="true">
        <WHENNOTCHANGED field="System.State">
          <READONLY />
        </WHENNOTCHANGED>
        <ALLOWEXISTINGVALUE />
      </FIELD>
      <FIELD name="State" refname="System.State" type="String" reportable="dimension">
        <HELPTEXT>Current status of the feedback request</HELPTEXT>
      </FIELD>
      <FIELD name="Reason" refname="System.Reason" type="String" reportable="dimension">
        <HELPTEXT>The reason why the feedback request is in its current state</HELPTEXT>
      </FIELD>
      <FIELD name="History" refname="System.History" type="History">
        <HELPTEXT>Discussion thread plus automatic record of changes</HELPTEXT>
      </FIELD>
      <FIELD name="Area Path" refname="System.AreaPath" type="TreePath" reportable="dimension">
        <HELPTEXT>The area of the product with which this feedback request is associated</HELPTEXT>
      </FIELD>
      <FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath" reportable="dimension">
        <HELPTEXT>The iteration within which this feedback was requested</HELPTEXT>
      </FIELD>
      <!-- ********** Application Launch fields ******************* -->
      <FIELD name="Application Type" refname="Microsoft.VSTS.Feedback.ApplicationType" type="String">
        <ALLOWEDVALUES expanditems="true">
          <LISTITEM value="Web application" />
          <LISTITEM value="Remote machine" />
          <LISTITEM value="Client application" />
          <LISTITEM value="Other" />
        </ALLOWEDVALUES>
        <REQUIRED />
        <HELPTEXT>The type of application on which to give feedback</HELPTEXT>
      </FIELD>
      <FIELD name="Application Start Information" refname="Microsoft.VSTS.Feedback.ApplicationStartInformation" type="PlainText">
        <HELPTEXT>The path to execute the application</HELPTEXT>
      </FIELD>
      <FIELD name="Application Launch Instructions" refname="Microsoft.VSTS.Feedback.ApplicationLaunchInstructions" type="HTML">
        <HELPTEXT>Instructions to launch the specified application</HELPTEXT>
      </FIELD>
      <!-- **************** Team Build Integration Fields **************  -->
      <FIELD name="Integration Build" refname="Microsoft.VSTS.Build.IntegrationBuild" type="String" reportable="dimension">
        <SUGGESTEDVALUES expanditems="true">
          <LISTITEM value="&lt;None&gt;" />
        </SUGGESTEDVALUES>
        <HELPTEXT>The build in which the feedback was requested</HELPTEXT>
      </FIELD>
    </FIELDS>
    <!-- *************** Workflow ****************   -->
    <WORKFLOW>
      <STATES>
        <STATE value="Active">
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <REQUIRED />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <EMPTY />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <EMPTY />
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Closed">
          <FIELDS>
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <REQUIRED />
            </FIELD>
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <REQUIRED />
            </FIELD>
          </FIELDS>
        </STATE>
        <STATE value="Removed" />
      </STATES>
      <TRANSITIONS>
        <TRANSITION from="" to="Active">
          <REASONS>
            <DEFAULTREASON value="New" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <COPY from="currentuser" />
              <VALIDUSER />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Active" to="Closed">
          <REASONS>
            <DEFAULTREASON value="Closed" />
          </REASONS>
          <FIELDS>
            <!-- Set the closing date -->
            <FIELD refname="Microsoft.VSTS.Common.ClosedDate">
              <SERVERDEFAULT from="clock" />
            </FIELD>
            <!-- Set the closing person -->
            <FIELD refname="Microsoft.VSTS.Common.ClosedBy">
              <COPY from="currentuser" />
              <VALIDUSER />
            </FIELD>
            <!-- Unassign the workitem -->
            <FIELD refname="System.AssignedTo">
              <COPY from="value" value="" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Closed" to="Active">
          <REASONS>
            <DEFAULTREASON value="Reactivated" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <COPY from="field" field="Microsoft.VSTS.Common.ClosedBy" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Active" to="Removed">
          <REASONS>
            <DEFAULTREASON value="Cancelled Feedback Request" />
          </REASONS>
        </TRANSITION>
      </TRANSITIONS>
    </WORKFLOW>
    <FORM>
      <Layout HideReadOnlyEmptyFields="true" HideControlBorders="true">
        <Group Margin="(0,0,0,5)">
          <Column PercentWidth="100">
            <Control FieldName="System.Title" Type="FieldControl" ControlFontSize="large" EmptyText="&lt;Enter title here&gt;" LabelPosition="Top" />
          </Column>
        </Group>
        <Group>
          <Column PercentWidth="70">
            <TabGroup>
              <Tab Label="Details">
                <Control FieldName="System.Description" Type="HtmlFieldControl" Label="Description" LabelPosition="Top" Dock="Fill" />
              </Tab>
              <Tab Label="Application">
                <Group>
                  <Column PercentWidth="100">
                    <Control FieldName="Microsoft.VSTS.Feedback.ApplicationType" Type="FieldControl" Label="Type" LabelPosition="Left" />
                    <Control FieldName="Microsoft.VSTS.Feedback.ApplicationStartInformation" Type="FieldControl" Label="Start Information" LabelPosition="Left" />
                    <Control FieldName="Microsoft.VSTS.Feedback.ApplicationLaunchInstructions" Type="HtmlFieldControl" Label="Launch Instructions" LabelPosition="Left" Dock="Fill" />
                  </Column>
                </Group>
              </Tab>
              <Tab Label="All Links">
                <Control Type="LinksControl" Name="GeneralLinks" LabelPosition="Top">
                  <LinksControlOptions>
                    <LinkColumns>
                      <LinkColumn RefName="System.ID" />
                      <LinkColumn RefName="System.WorkItemType" />
                      <LinkColumn RefName="System.Title" />
                      <LinkColumn RefName="System.AssignedTo" />
                      <LinkColumn RefName="System.State" />
                      <LinkColumn LinkAttribute="System.Links.Comment" />
                    </LinkColumns>
                    <WorkItemLinkFilters FilterType="includeAll" />
                    <ExternalLinkFilters FilterType="includeAll" />
                    <WorkItemTypeFilters FilterType="includeAll" />
                  </LinksControlOptions>
                </Control>
              </Tab>
              <Tab Label="History">
                <Control FieldName="System.History" Type="WorkItemLogControl" Label="Histor&amp;y" LabelPosition="Top" Dock="Fill" />
              </Tab>
            </TabGroup>
          </Column>
          <Column PercentWidth="30">
            <Group Margin="(5,0,0,0)">
              <Column PercentWidth="100">
                <Group Label="Status">
                  <Column PercentWidth="100">
                    <Control FieldName="System.AssignedTo" EmptyText="&lt;No one&gt;" Type="FieldControl" Label="Assi&amp;gned To" LabelPosition="Left" />
                    <Control FieldName="System.State" Type="FieldControl" Label="Stat&amp;e" LabelPosition="Left" />
                  </Column>
                </Group>
                <Group Label="Classification">
                  <Column PercentWidth="100">
                    <Control FieldName="System.AreaPath" Type="WorkItemClassificationControl" Label="&amp;Area" LabelPosition="Left" />
                    <Control FieldName="System.IterationPath" Type="WorkItemClassificationControl" Label="Ite&amp;ration" LabelPosition="Left" />
                  </Column>
                </Group>
              </Column>
            </Group>
          </Column>
        </Group>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</Witd:WITD>